package ooday05.homework;

/**
 * 1. 完成Point类，演示访问控制修饰符的用法
 */
public class Point {
    // 实例变量：private
    private int x;
    private int y;

    // getter、setter:public
    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    // 构造方法:public
    public Point() {
    }

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    // 方法:public
    public void swim() {
        System.out.println("喜欢游泳...");
    }
}
